package com.zhiyin.seal.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhiyin.seal.entity.AlarmRecordEntity;
import com.zhiyin.seal.entity.SealEntity;
import com.zhiyin.seal.entity.SealFingerPrintEntity;
import com.zhiyin.seal.entity.SealReplaceEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface SealDao extends BaseMapper<SealEntity> {

    SealEntity selectSealById(@Param("id") Long id);

    SealEntity selectSealByIdAndCompany(@Param("id") Long id,@Param("companyId") Long companyId);

    SealEntity selectSealByMac(@Param("mac") String mac);

    List<SealEntity> selectAllSealList(@Param("keywords") String keywords);

    Integer insertSeal(@Param("seal") SealEntity sealEntity);

    Integer insertSealCompany(@Param("seal") SealEntity sealEntity);

    Integer updateSeal(@Param("seal") SealEntity sealEntity);

    List<SealEntity> selectSealListByIdsAndCompany(@Param("sealIds") List<Long> sealIds,@Param("companyId") Long companyId);

    List<SealEntity> selectCompanySealList(@Param("companyId") Long companyId);

    List<SealEntity> selectCompanySealList2(@Param("companyId") Long companyId);

    List<SealEntity> selectApplySealList(@Param("userId") Long userId);

    List<SealEntity> selectMySealList(@Param("userId") Long userId);

    SealReplaceEntity selectSealReplaceByMac(@Param("mac") String mac);

    Integer insertSealReplace(@Param("sealReplace") SealReplaceEntity sealReplaceEntity);

    Integer updateSealName(@Param("sealId") Long sealId,@Param("name") String name);

    Integer updateSealServiceTime(@Param("sealId") Long sealId,@Param("serviceTime") String serviceTime);

    Integer updateSealForcePhotograph(@Param("sealId") Long sealId,@Param("forcePhotograph") Boolean forcePhotograph);

    Integer updateSealFacePhoto(@Param("sealId") Long sealId,@Param("facePhoto") Boolean facePhoto);

    Integer updateSealDepartment(@Param("sealId") Long seal,@Param("departmentId") Long departmentId);

    Integer updateSealStatus(@Param("sealId") Long seal,@Param("status") Integer status);

    Integer removeSealCompany(@Param("userId") Long userId,@Param("sealId") Long sealId);

    Integer removeSealCompanyBySealId(@Param("sealId") Long sealId);

    Integer deleteCompanyAllSeal(@Param("companyId") Long companyId);

    Integer deleteSealAdmin(@Param("sealId") Long sealId);

    Integer insertFingerprint(@Param("fingerprint") SealFingerPrintEntity sealFingerPrintEntity);

    Integer updateFingerprint(@Param("fingerprint") SealFingerPrintEntity sealFingerPrintEntity);

    Integer removeFingerprint(@Param("id") Long id,@Param("deleteUser") Long deleteUser);

    List<SealFingerPrintEntity> selectFingerprintList(@Param("companyId") Long companyId, @Param("sealId") Long sealId);

    Integer selectSealCount();
}
